package com.gerry.demo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.demo.user.scanpackage.service.UserService;

/**
 * 测试注解方式管理依赖
 * @author Administrator
 *
 */
public class TestScanPackage {
	public static void main(String[] args) {
		/*// 创建Stduent对象
		Student stu = new Student();*/
		
		// Spring容器实例化
		ApplicationContext ctx = new ClassPathXmlApplicationContext("container-scan.xml");
		// 获取service实例
		UserService userService = (UserService) ctx.getBean("userService");
		userService.saveUser();
	}
}
